package com.itheima.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.bean.OrderDetail;
import com.itheima.dao.OrderDetailDao;
import com.itheima.service.OrderDetailService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Tang
 * @date 2023/2/25
 */
@Service
public class OrderDetailServiceImpl extends ServiceImpl<OrderDetailDao, OrderDetail> implements OrderDetailService {
    /**
     * 完善用户订单查询其他信息
     *
     * @param orderId
     * @return
     */
    @Override
    public List<OrderDetail> getByOrderId(Long orderId) {
        LambdaQueryWrapper<OrderDetail> lqw = new LambdaQueryWrapper<>();
        lqw.eq(OrderDetail::getOrderId, orderId);
        List<OrderDetail> detailList = this.list(lqw);
        return detailList;
    }
}
